package com.neouton.crm.sales.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neouton.crm.sales.entity.SalesFileRelationVO;
import com.neouton.crm.sales.mapper.SalesFileRelationMapper;
import com.neouton.crm.sales.service.SalesFileRelationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SalesFileRelationServiceImpl extends ServiceImpl<SalesFileRelationMapper, SalesFileRelationVO> implements SalesFileRelationService {
    @Resource
    SalesFileRelationMapper salesFileRelationMapper;

    @Override
    public SalesFileRelationVO selectByPrimaryKey(Integer Id) {
        return salesFileRelationMapper.selectByPrimaryKey(Long.valueOf(Id));
    }

    @Override
    public boolean deleteFileLogic(SalesFileRelationVO file) {
        return salesFileRelationMapper.deleteFileLogic(file) != 0;
    }

    @Override
    public boolean deleteFileInfo(String fileId,Integer fileClass) {
        return salesFileRelationMapper.deleteFileInfo(fileId,fileClass) != 0;
    }

    @Override
    public boolean deleteFileBySalesFileId(String fileId) {
        return salesFileRelationMapper.deleteFileBySalesFileId(fileId);
    }

    @Override
    public List<SalesFileRelationVO> queryFileByRelationIdAndFileClass(Integer salesRelationId,Integer fileClass){
        return salesFileRelationMapper.queryFileByRelationIdAndFileClass(salesRelationId,fileClass);
    }
}
